<?php
use yii\helpers\Html;
use \backend\controllers\DtActionFilter;
$project_id = Yii::$app->request->get("project_id");

if (!empty($project_id)){
    $isView = DtActionFilter::checkProject('project_edit',$project_id);
}else{
    $isView=true;
    return '无用户id';
}
?>
<div class="container containerShadow">
        <div class="row">
            <div class="topimg clearfix">
                <div class="left pull-left">
                    <span>转让信息</span>
                </div>
                <div class="pull-right">
                    <a href="javascript:void(0)">
                        <?php
                        if (!empty($isView)){
                            echo Html::img("/image/projectDetails/edit.png",["id"=>"getBase","id"=>"getMake","data-val"=>9]);
                        }
                        ?>
                    </a>
                </div>
                <div class="text clearfix">
                    <span>资产包提供方</span>
                    <?php
                        if (!empty($transfer['ju']['transfer']) && $transfer['ju']['transfer']==2){
                            echo '<span>居间人</span>';
                        }else if(!empty($transfer['chi']['transfer']) && $transfer['chi']['transfer']==1){
                            echo '<span>持有人</span>';
                        }else{
                            echo '<span>无数据</span>';
                        }
                    ?>
                </div>
                <div class="bottom">
                    <?php
                    if (!empty($transfer['ju']['transfer']) && $transfer['ju']['transfer']==2){
                        echo '<span>居间人信息</span><span>持有人信息</span>';
                    }else if(!empty($transfer['chi']['transfer']) && $transfer['chi']['transfer']==1){
                        echo '<span>持有人信息</span>';
                    }else{
                        echo '<span>无数据</span>';
                    }
                    ?>
                </div>
            </div>
            <div class="tableBox clearfix">
                <?php
                if (!empty($transfer)){
                    if (!empty($transfer['ju']['transfer']) && $transfer['ju']['transfer']==2){
                        $contactJu = !empty($transfer['ju']['contact'])?$transfer['ju']['contact']:'' ;
                        $phoneJu = !empty($transfer['ju']['phone'])?$transfer['ju']['phone']:'' ;
                        $emailJu = !empty($transfer['ju']['email'])?$transfer['ju']['email']:'' ;
                        $addressJu = !empty($transfer['ju']['address'])?$transfer['ju']['address']:'' ;
                        $positionJu = !empty($transfer['ju']['position'])?$transfer['ju']['position']:'' ;
                        $remarkJu = !empty($transfer['ju']['remark'])?$transfer['ju']['remark']:'' ;
                        //------------------------持有人--------------------
                        $contactChi = !empty($transfer['chi']['contact'])?$transfer['chi']['contact']:'' ;
                        $phoneChi = !empty($transfer['chi']['phone'])?$transfer['chi']['phone']:'' ;
                        $emailChi = !empty($transfer['chi']['email'])?$transfer['chi']['email']:'' ;
                        $addressChi = !empty($transfer['chi']['address'])?$transfer['chi']['address']:'' ;
                        $positionChi = !empty($transfer['chi']['position'])?$transfer['chi']['position']:'' ;
                        $remarkChi = !empty($transfer['chi']['remark'])?$transfer['chi']['remark']:'' ;
                        echo <<<JU
    <table class="tableRaius pull-left trTopNone tableLeft" border="0" cellspacing="0" cellpadding="0" style="border-collapse:separate;border-spacing: 0;">
                    <tr>
                        <td>联系人</td>
                        <td>
                        	<pre>$contactJu</pre>
                        </td>
                    </tr>
                    <tr>
                        <td>电 话</td>
                        <td class="telTd">
                        	<input type="text"  value="$phoneJu"/>
                        </td>
                    </tr>
                    <tr>
                        <td>地 址</td>
                        <td>
                        	<pre>$addressJu</pre>
                        </td>
                    </tr>
                    <tr>
                        <td>邮 箱</td>
                        <td>
                        	<input type="text" style="padding-left:14px!important"  value="$emailJu"/>
                        </td>
                    </tr>
                    <tr>
                        <td>职 位</td>
                        <td>
                        	<pre>$positionJu</pre>
                        </td>
                    </tr>
                    <tr>
                        <td>备 注</td>
                        <td>
                        	<pre>$remarkJu</pre>
                        </td>

                    </tr>
                </table>
    <table class="tableRaius trTopNone pull-right tableRight" border="0" cellspacing="0" cellpadding="0" style="border-collapse:separate;border-spacing: 0;">
                    <tr>
                        <td>联系人</td>
                        <td>
                        	<pre>$contactChi</pre>
                        </td>
                    </tr>
                    <tr>
                        <td>电 话</td>
                        <td class="telTd">
                        	<input type="text"   value="$phoneChi"/>
                        </td>
                    </tr>
                    <tr>
                        <td>地 址</td>
                        <td>
                        	<pre>$addressChi</pre>
                        </td>
                    </tr>
                    <tr>
                        <td>邮 箱</td>
                        <td>
                        	<input type="text" style="padding-left:14px!important"  value="$emailChi"/>
                        </td>
                    </tr>
                    <tr>
                        <td>职 位</td>
                        <td>
                        	<pre>$positionChi</pre>
                        </td>
                    </tr>
                    <tr>
                        <td>备 注</td>
                        <td>
                        	<pre>$remarkChi</pre>
                        </td>

                    </tr>
                </table>
JU;
                    }else if(!empty($transfer['chi']['transfer']) && $transfer['chi']['transfer']==1){
                        $contact = !empty($transfer['chi']['contact'])?$transfer['chi']['contact']:'' ;
                        $phone = !empty($transfer['chi']['phone'])?$transfer['chi']['phone']:'' ;
                        $email = !empty($transfer['chi']['email'])?$transfer['chi']['email']:'' ;
                        $address = !empty($transfer['chi']['address'])?$transfer['chi']['address']:'' ;
                        $position = !empty($transfer['chi']['position'])?$transfer['chi']['position']:'' ;
                        $remark = !empty($transfer['chi']['remark'])?$transfer['chi']['remark']:'' ;
                        echo <<<CHI
    <table class="tableRaius pull-left ch" border="0" cellspacing="0" cellpadding="0" style="border-collapse:separate;border-spacing: 0;">
                    <tr>
                        <td>联系人</td>
                        <td>&nbsp;$contact</td>
                    </tr>
                    <tr>
                        <td >电 话</td>
                        <td>&nbsp;$phone</td>
                    </tr>
                    <tr>
                        <td>地 址</td>
                        <td>&nbsp;$address</td>
                    </tr>
                    <tr>
                        <td>邮 箱</td>
                        <td>&nbsp;$email</td>
                    </tr>
                    <tr>
                        <td>职 位</td>
                        <td>&nbsp;$position</td>
                    </tr>
                    <tr>
                        <td>备 注</td>
                        <td>
                        	<pre>$remark</pre>
                        </td>

                    </tr>
                </table>
CHI;
                    }else{
                        echo "无数据";
                    }
                }
                ?>
            </div>
            <div class="zhuanRang zhuanRangS">
                <p class="">
                    <span>转让方式</span>
                 <?php
	                    if(!empty($transfer['chi']['transfer']) && $transfer['chi']['transfer']==1){
	                        if (!empty($transfer['chi']['method'])){
	                            echo '<span style="margin-left:46px">'.Yii::$app->params['project_transfer_method'][$transfer['chi']['method']]['name'].'</span>';
	                        }else{
	                            echo '<span>无数据</span>';
	                        }
	                    }else{
	                        echo '<span>无数据</span>';
	                    }
	             ?>
                </p>
                <p class="">
                    <span>预计转让时间</span>
                    <span><pre class="timePre" style="margin-left: 90px;"><?= !empty($transfer['chi']['expected_transfer'])?$transfer['chi']['expected_transfer']:'';?></pre></span>
                </p>
<!--                <p>-->
<!--                    <span>转让时间</span>-->
<!--                    <span>整包</span>-->
<!--                </p>-->
                <p class="zhuanRangText">
                    <span class="pull-left">转让意愿</span>
                    <?php
                    if(!empty($transfer['chi']['transfer']) && $transfer['chi']['transfer']==1){
                        if (!empty($transfer['chi']['wish'])){
                            echo '<pre class="zhuanRangPre">'.$transfer['chi']['wish'].'</pre>';
                        }else{
                            echo '<pre class="zhuanRangPre">无数据</pre>';
                        }
                    }else{
                        echo '<pre class="zhuanRangPre">无数据</pre>';
                    }
                    ?>
                </p>
                <p class="zhuanRangJiaGe pull-left">
                    <span>转让价格</span>
                    <?php
                    if(!empty($transfer['chi']['transfer']) && $transfer['chi']['transfer']==1){
                        if (!empty($transfer['chi']['detail'])){
                            echo '<pre class="zhuanRangPre2">'.$transfer['chi']['detail'].'</pre>';
                        }else{
                            echo '<pre class="zhuanRangPre2">无数据</pre>';
                        }
                    }else{
                        echo '<pre class="zhuanRangPre2">无数据</pre>';
                    }
                    ?>
                </p>
            </div>
        </div>
    </div>
    
    
    <script type="text/javascript">
    	
    	
    $(function(){
    		
    	//等待优化(居间人信息和持有人信息高度同步)
    	for(var i = 0; i < $('.tableRight').find('tr').length; i++){
    		if($('.tableRight').find('tr').eq(i).height()>$('.tableLeft').find('tr').eq(i).height()){
    			$('.tableLeft').find('tr').eq(i).height($('.tableRight').find('tr').eq(i).height())
    		}else{
    			$('.tableRight').find('tr').eq(i).height($('.tableLeft').find('tr').eq(i).height())
    		}
    	}
    	
    })
    	
    	
    </script>
